<template>
	<view class="page_box">		
		<view class="mingxi">
			<view class="ticheng">
				<block >
					<li class="tc" >
						<view class="tc_l">
							<span>转介绍收益-李小龙</span><br/>
						</view>
						<view class="tc_2">
							+1.00
						<br/>
							<span>进行中</span>
						</view>
					</li>
					<li class="tc" >
						<view class="tc_l">
							<span>转介绍收益-李小龙</span><br/>
						</view>
						<view class="tc_2">
							+1.00
						<br/>
							<span>进行中</span>
						</view>
					</li>
					<li class="tc" >
						<view class="tc_l">
							<span>转介绍收益-李小龙</span><br/>
						</view>
						<view class="tc_2">
							+1.00
						<br/>
							<span>进行中</span>
						</view>
					</li>
				</block>
			</view>
		</view>
		<!-- 自定义底部导航 -->
		<!-- <shopro-tabbar></shopro-tabbar> -->
		<!-- 关注弹窗 -->
		<!-- <shopro-float-btn></shopro-float-btn> -->
		<!-- 连续弹窗提醒 -->
		<!-- <shopro-notice-modal></shopro-notice-modal> -->
		<!-- 登录提示 -->
		<!-- <shopro-login-modal></shopro-login-modal> -->
	</view>
</template>

<script>
import shoproMiniCard from '@/components/shopro-mini-card/shopro-mini-card.vue';
import shoproEmpty from '@/components/shopro-empty/shopro-empty.vue';
export default {
	components: {
		shoproMiniCard,
		shoproEmpty
	},
	data() {
		return {
			isSel: false,
			allSel: false,
			routerTo: this.$Router,
			selList: [],
			emptyData: {
				img: '/static/imgs/empty/empty_goods.png',
				tip: '暂无分销客户'
			},
			customerList: [],
			total: 0,
			loadStatus: '', //loading,over
			currentPage: 1,
			lastPage: 1,
			showShare:false,
			showShareUrl:"",
		};
	},
	computed: {},
	onShow() {
		this.init();
	},
	onHide() {
		this.dealerList = [];
	},
	methods: {
		// init
		init() {
			return Promise.all([this.GetDistributeUsers()]);
		},
		onSel(e) {
			let items = this.dealerList,
				values = e.detail.value;
			this.selList = values;
			items.forEach(i => {
				if (values.includes(i.goods_id.toString())) {
					this.$set(i, 'checked', true);
				} else {
					this.$set(i, 'checked', false);
				}
			});
			if (this.selList.length < items.length) {
				this.allSel = false;
			} else {
				this.allSel = true;
			}
		},
		onSet() {
			this.isSel = !this.isSel;
		},
		onAllSel() {
			this.allSel = !this.allSel;
			this.selList = [];
			const { dealerList } = this;
			dealerList.forEach(i => {
				if (this.allSel) {
					this.$set(i, 'checked', true);
					this.selList.push(i.goods_id);
				} else {
					this.$set(i, 'checked', false);
				}
			});
		},
		// 加载更多
		loadMore() {
			if (this.currentPage < this.lastPage) {
				this.currentPage += 1;
				this.GetDistributeUsers();
			}
		},
		// 收藏列表
		GetDistributeUsers() {
			let that = this;
			let userInfo=JSON.parse(uni.getStorageSync("userInfo"));
			
			uni.request({
			    url: this.$config.API_URL+"Distribute/GetDistributeUsers",
				method:"POST",
				data:{
					"uid":userInfo.StoreUserInfo.Uid
				},
				success: (result) => {					
					that.customerList = result.data;
					
				},
			})
		},
		// 路由跳转
		jump(path, parmas) {
			this.$Router.push({
				path: path,
				query: parmas
			});
		},
		share(f){
			this.showShare=true;
			let url='/pages/app/dealer/index';
			this.showShareUrl=window.location.href.replace("/pages/app/dealer/myCustomer",url)+"?title="+f.pagetitle+"&name="+f.buttonname+"&code="+f.code;
		},
		onCopy() {
			let that = this;
			uni.setClipboardData({
				data: this.showShareUrl,
				success: function(data) {
					//#ifdef H5
					that.$tools.toast('已复制到剪切板');
					//#endif
				},
				fail: function(err) {},
				complete: function(res) {}
			});
		},
	}
};
</script>
<style lang="less">
.mingxi{
	.head{display: flex;margin: 10px 0;}
	.head_l{display: flex;width: 85%;justify-content: space-around;}
	.head_r{width: 15%;text-align: center;}
	.head_l_1{border: 1px solid #F2F2F2;padding: 0px 15px;line-height: 25px;}
	.head_btn{margin:10px 20px 0;border: 1px solid #F2F2F2;padding: 0px 15px;line-height: 25px;}
	.ling{color: #E1461D;border: 1px solid #E1461D;padding: 0px 15px;line-height: 25px;}
	.shouyi{border-top: 1px solid #EBEBEB;border-bottom:1px solid #EBEBEB; background-color: #FAFAFA;display: flex;height: 30px;
	line-height: 30px;padding: 3px 10px;margin-top: 15px;}
	.sy_l{width: 50%;}
	.sy_l span{font-weight: bold;}
	.ticheng li:nth-of-type(odd){ background-color: #EEEEEE;} 
	.ticheng li:nth-of-type(even){background-color: #fff;} 
	.tc{display: flex;justify-content: space-between;padding: 10px;line-height: 25px;font-size: 14px;}
	.tc_l{color: #9A9A9A;}
	.tc_l span{font-size: 14px;font-weight: bold;color: #000;}
	.tc_2{color: #E1461D;}
	.tc_2 span{color: #9A9A9A;}
}
</style>
